#include <amxmodx>
#include <amxmisc>
#include <dprp>
#include <fun>

// not needed, only if you want to use for a comparison (reason for stock)
stock g_ItemId

public plugin_init()
{
	// old register, also must manually add it to the SQL
	/*
	register_srvcmd("item_stealth","item_stealth")
	*/
	
	// new register, no need to add to SQL
	// returns item id, which is stored in g_ItemId
	g_ItemId = DPRP_RegisterItem("Sneakers","item_stealth","Allows silent movement.",0)
}

// old code

/*

public item_stealth(){
	new id,arg[32]
	read_argv(1,arg,31)
	id = str_to_num(arg)
	if(!is_user_alive(id)) return PLUGIN_HANDLED
	
	if(!get_user_footsteps(id)) {
		set_user_footsteps(id, 1)
		client_print(id,print_chat,"[ClothesMod] You have put on your sneakers.")
	}
	else{
		set_user_footsteps(id, 0)
		client_print(id,print_chat,"[ClothesMod] You taken off your sneakers.")
	}
}

*/

// new code

public item_stealth(id,ItemId){
	if(!get_user_footsteps(id)) {
		set_user_footsteps(id, 1)
		client_print(id,print_chat,"[ClothesMod] You have put on your sneakers.")
	}
	else{
		set_user_footsteps(id, 0)
		client_print(id,print_chat,"[ClothesMod] You taken off your sneakers.")
	}
}
